#pragma once

namespace	MomogenkyouContent	{

class FadeInOut
{
protected:
	bool	m_bEnded;		//	Whether this effect has Ended or stopped
	bool	m_bProceed;		//	Whether this effect can proceed to Fade out
	
	float	m_fElapsedTime;	//	Time since Start is called

	float	m_fFadeInTime;	//	Time taken to fade in
	float	m_fVisibleTime;	//	Time taken to stay visible
	float	m_fFadeOutTime;	//	Time taken to fade out

	float	m_fAlphaValue;	//	Alpha Value

	size_t	m_iPhase;
public:
	FadeInOut();
	virtual	~FadeInOut();
	
	__inline	bool	HasEnded()		const	{	return	m_bEnded;		}
	__inline	float	ElapsedTime()	const	{	return	m_fElapsedTime;	}
	__inline	float	Opacity()		const	{	return	m_fAlphaValue;	}

	__inline	void	Proceed(bool bNext)		{	m_bProceed	=	bNext;	}

	void	Start(const float & fIn, const float & fStay, const float & fOut);
	void	Update(const float & fInterval);
};

}